import VueRouter from "vue-router";
import Home from "../pages/Home.vue";
import About from "../pages/About.vue";
import News from "../pages/News.vue";
import Message from "../pages/Message.vue";
import Detail from "../pages/Detail.vue";
export default new VueRouter({
    routes:[
        {
            path:"/home",
            component:Home,
            children:[
                {
                    path:'news',
                    component: News,
                    children:[
                        {   
                            name:'xiangqing',
                            path:'detail/:id/:title',
                            component: Detail,
                            props: true,
                        }
                    ]
                },
                {
                    path:'message',
                    component: Message,
                    children:[
                        {   
                            name:'xiangqing',
                            path:'detail/:id/:title',
                            component: Detail,
                            //props对象写法(很少用)
                            //props:{a:'1',b:'2'}
                            //props布尔写法,
                            props: true,
                        }
                    ]

                }
            ],
        },
        {
            path:"/about",
            component:About
        }
    ]
})